Skip to content

Conversation

@bsbodden
Copy link
Contributor

Resolves issue #24 where Redis key decoding would fail when a client
was configured with decode_responses=True. Adds a new safely_decode
utility function that handles both bytes and string keys.

@bsbodden bsbodden requested review from tylerhutcherson and removed request for tylerhutcherson April 30, 2025 22:05
@bsbodden
Copy link
Contributor Author

@tylerhutcherson an experimental PR to test the bytes/string encoding issue. Some CI issues on this one, will let it sit and handle it before the release (or push it for the next one, it's not critical)

return value


def safely_decode(key: Union[bytes, str]) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsbodden good news -- https://github.com/redis/redis-vl-python/blob/9f22a9ad4c2166af6462b007833b456448714dd9/redisvl/redis/utils.py#L20
We have this util already in redisvl that is tested and should work for this use case :)

@bsbodden bsbodden merged commit 6331627 into main May 13, 2025
19 checks passed
@bsbodden bsbodden deleted the bsb/issue-24 branch May 13, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants